package com.qf.test;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * projectName: Spring
 *
 * @author: MaTianWei
 * time: 2021/6/28 21:42
 * description:
 */

public class Demo1 {
    @Test
    public void Test(){
        //1·加载配置文件，获取spring工厂
        ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        //2·获取sqlSession
        Object sqlSession1 = ac.getBean("sqlSession");
        Object sqlSession2 = ac.getBean("sqlSession");
        Object sqlSession3 = ac.getBean("sqlSession");
        //3·输出
        System.out.println(sqlSession1);
    }
}
